<!-- /* Description for file.
 * 修改进度
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/users
 * @since         ues
 * @version       V0.0.1
 * @modifiedby    张海杰2011年0729
 * @lastmodified  张海杰2011年0729
 */
 -->
 
<?php
echo $html->css ( 'jquery-validate/css/screen' );
//echo $javascript->link('jquery');
echo $html->css('start/jquery-ui-1.8.2.custom');
echo $javascript->link('jquery-ui-1.8.2.custom.min');

?>

<script type="text/javascript">
////添加人机构、添加人部门
$(document).ready(function() {
	$("#logranid").change(function(){
		var company = $(this).val();
		/*if(company!="")
		{*/
			$.post("<?php echo ROOT_WEB_PATH; ?>/organs/organsQuery/",{
				Organ : $(this).val()
				},function(data,textStatus){
					 $("#ldepartmentid:eq(0)>option").remove();
					 $(data).find("aaa").each(function(){
					 $("#ldepartmentid:eq(0)").append("<option></option>");
					 if($(this).text()=="不限")
					 {
						 $("#ldepartmentid:eq(0)>option:last").val("").html("全部");
					 }
					 else
					 {
						 $("#ldepartmentid:eq(0)>option:last").val($(this).attr("name")).html($(this).text());
					 }
				  });
				});
		/*}
		else
		{
			$("#ldepartmentid:eq(0)>option").remove();
			$("#ldepartmentid:eq(0)").append("<option></option>");
			$("#ldepartmentid:eq(0)>option:last").val("").html("不限");
		}*/
	});
});


//添加人部门、添加人关联查询
$(document).ready(function() {
	$("#ldepartmentid").change(function(){
		var department = $(this).val();
		/*if(department!="")
		{*/
			$.post("<?php echo ROOT_WEB_PATH; ?>/companymanages/createrQuery/",{
				User : $(this).val(),
				organ :$("#logranid").val()
				},function(data,textStatus){
					 $("#linkmanid:eq(0)>option").remove();
					 $(data).find("aaa").each(function(){
					 $("#linkmanid:eq(0)").append("<option></option>");
					 if($(this).text()=="不限")
					 {
						 $("#linkmanid:eq(0)>option:last").val("").html("全部");
					 }
					 else
					 {
						 $("#linkmanid:eq(0)>option:last").val($(this).attr("name")).html($(this).text());
					 }
				  });
				});
		/*}
		else
		{
			$("#linkmanid:eq(0)>option").remove();
			$("#linkmanid:eq(0)").append("<option></option>");
			$("#linkmanid:eq(0)>option:last").val("").html("不限");
		}*/
	});
});


//添加人机构、添加人关联查询
$(document).ready(function() {
	$("#logranid").change(function(){
		var department = $(this).val();
		/*if(department!="")
		{*/
			$.post("<?php echo ROOT_WEB_PATH; ?>/companymanages/createrQuery/",{
				User : $(this).val(),
				organ :$("#logranid").val()
				},function(data,textStatus){
					 $("#linkmanid:eq(0)>option").remove();
					 $(data).find("aaa").each(function(){
					 $("#linkmanid:eq(0)").append("<option></option>");
					 if($(this).text()=="不限")
					 {
						 $("#linkmanid:eq(0)>option:last").val("").html("全部");
					 }
					 else
					 {
						 $("#linkmanid:eq(0)>option:last").val($(this).attr("name")).html($(this).text());
					 }
				  });
				});
		/*}
		else
		{
			$("#linkmanid:eq(0)>option").remove();
			$("#linkmanid:eq(0)").append("<option></option>");
			$("#linkmanid:eq(0)>option:last").val("").html("不限");
		}*/
	});
});

//添加验证
$(document).ready(function() {

	//验证是否必填
	function test(id)
	{
		var srt = "font#" + id;
		var isValidate =  $(srt).text();
		var validate = $.trim(isValidate);
		if(validate == "*"){
			return true;
		} else {
			return false;
		}
	}

	$.validator.setDefaults({       
		 submitHandler: function(form) {    
		  form.submit();    
		}       
	});   
			
// validate signup form on keyup and submit
$("#CandidateEditForm").validate({ 
rules: {
"data[Candidate][nominateTime]" : {
required: false 
},//推荐时间
"data[Candidate][trystart]" : {
required: false,dateISO:true
},
"data[Candidate][tryend]" : {
required: false,dateISO:true
},
"data[Candidate][trylength]" : {
required: false,digits:true
},						
"data[Candidate][remindBefore]" : {
required: false,digits:true
},
"data[Candidate][remindSpacing]" : {
required: false,digits:true
},
"data[Candidate][memo]" : {
required: false,string:true,stringMinLength:0,stringMaxLength:200
}
},

focusInvalid:false,
onkeyup:false,
errorPlacement:function(error, element){
	error.appendTo(element.parent());
}
});
});
</script>

<script type="text/javascript">
	$(function(){
		$(".datepickerSpan :input").datepicker({
			inline: true
		});
		 $('.datepickerSpan :input').datepicker('option', {dateFormat: "yy-mm-dd"});
		 $('.datepickerSpan :input').datepicker( "option", "closeText", 'X' );
		 $("#nominateTime").val("<?php echo $data['Candidate']['nominateTime'];?>");
		 $("#trystart").val("<?php echo $data['Candidate']['trystart'];?>");
		 $("#tryend").val("<?php echo $data['Candidate']['tryend'];?>");
		 $("#signDate").val("<?php echo $data['Candidate']['signDate'];?>");
	});
</script>
<script type="text/javascript">
	function mycheck() {
		$("#CandidateEditForm").submit();	
	}
</script>
<style>
.input{
	float:left;
}
</style>
<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Projectmanagements');//一级目录
										   echo '>';echo __('Projectmanagements');//二级目录
										   echo '>';echo __('Candidate Management');//三级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('Candidate Management Edit',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->
<?php echo $form->create('Candidate',array('action'=>'edit','type'=> 'post'));?>
<?php echo $form->hidden('id',array('default'=>$data['Candidate']['id']));?>
<?php echo $form->hidden('projectmanagementid',array('default'=>$data['Candidate']['projectmanagement_id']));?>
<?php echo $form->hidden('resume',array('default'=>$data['Resume']['name']));?>
<?php echo $form->hidden('scheduleid',array('default'=>$data['Candidate']['scheduleid']));?>
<div class="tabflex">
<fieldset><legend><?php echo __('Candidate Management Edit',true);//修改进度?></legend>
<table width="100%" cellspacing="0" cellpadding="0" border="0"
	style="text-align: left">
	<tr>
	<td width="50"></td>
	<td width="100">候选人名</td>
	<td ><?php echo $form->input('Resume.name',array('default'=>$data['Resume']['name'],'class' => 'TextBoxL txtOut','div'=>false,'label'=>false,'disabled'=>true));?></td>
	
	<td width="50"></td>
	<td width="100">客户反馈</td>
	<?php $option2=array("无"=>"无","拒绝"=>"拒绝","进行下一轮"=>"进行下一轮","签约"=>"签约"); ?>
	<td ><?php echo $form->input('customerFeedback',array('options'=>$option2,'default' =>$data['Candidate']['customerFeedback'],'class' => 'TextBoxE3','div'=>false,'label'=>false));?></td>
	
	</tr>
	<tr>
	<td></td>
	<td>收费情况</td>
	<?php 
	 $option6=array("未收费"=>"未收费","已收费"=>"已收费");
	?>
	<td ><?php echo $form->input('fee',array('options'=>$option6,'default'=>$data['Candidate']['fee'],'class' => 'TextBoxL txtOut','label'=>false));?></td>
	
	<td></td>
	<td>候选人反馈</td>
	<td ><?php echo $form->input('feedback',array('options'=>$option2,'default'=>$data['Candidate']['feedback'],'class' => 'TextBoxL txtOut','label'=>false));?></td>
	
	</tr>
	<tr>
	<td></td>
	<td>是否到职</td>
	<?php $option3=array("未到职"=>"未到职","到职"=>"到职");?>
	<td ><?php echo $form->input('hasreport',array('options'=>$option3,'default'=>$data['Candidate']['hasreport'],'class' => 'TextBoxL txtOut','div'=>false,'label'=>false));?></td>
	
	<td></td>
	<td>完成情况</td>
	
	<?php 
	 $option4=array("未完成"=>"未完成","完成"=>"完成");
	?>
	<td ><?php echo $form->input('hasfinish',array('options'=>$option4,'default' =>$data['Candidate']['hasfinish'],'class' => 'TextBoxE3','div'=>false,'label'=>false));?></td>
	
	</tr>
	<tr>
	<td></td>
	<td>推荐时间</td>
	<td >
	<span class="datepickerSpan">
	<?php echo $form->text('nominateTime',array('default'=>$data['Candidate']['nominateTime'],'id'=>'nominateTime','class' => 'TextBoxL txtOut','label'=>false));?>
	</span>
	</td>
	
	<td></td>
	<td>推荐人</td>
	<td >
	<?php echo $form->input('logranid',array('options'=>$organlist,'default'=>$user['Organ']['id'],"id"=>'logranid','label'=>false));?>
	<?php echo $form->input('departmentlist',array('options'=>$departmentlist,'default'=>$user['Department']['id'],"id"=>'ldepartmentid','label'=>false));?>
	<?php echo $form->input('userlist',array('options'=>$userlist,'default'=>$data['Candidate']['user_id'],"id"=>'linkmanid','label'=>false));?>
	</td>
	
	</tr>
	
	<tr>
	<td></td>
	<td>签协议时间</td>
	<td >
	<span class="datepickerSpan">
	<?php echo $form->input('signDate',array('default'=>$data['Candidate']['signDate'],'id'=>'signDate','class' => 'TextBoxL txtOut','label'=>false));?>
	</span>
	</td>
	<td colspan="3"></td>
	<tr>
	<tr>
	<td colspan="6"><legend><?php echo __('试用期限',true);//试用期限?></legend></td>
	</tr>
	
	<td></td>
	<td>开始时间</td>
	<td >
	<span class="datepickerSpan">
	<?php echo $form->input('trystart',array('default'=>$data['Candidate']['trystart'],'id'=>'trystart','class' => 'TextBoxL txtOut','label'=>false));?>
	</span>
	</td>
	
	
	<td></td>
	<td>结束时间</td>
	<td >
	<span class="datepickerSpan">
	<?php echo $form->input('tryend',array('default'=>$data['Candidate']['tryend'],'id'=>'tryend','class' => 'TextBoxL txtOut','label'=>false));?>
	</span>
	</td>
	
	
	</tr>
	<tr>
	<td></td>
	<td>保证期</td>
	<td ><?php echo $form->input('trylength',array('after'=>'&nbsp;个月','default'=>$data['Candidate']['trylength'],'class' => 'TextBoxL txtOut','label'=>false));?></td>
	
	<td></td>
	<td>进度</td>
	<td ><?php echo $form->input('candidateprocess_id',array('options'=>$op4,'default'=>$data['Candidateprocess']['id'],'class' => 'TextBoxL txtOut','label'=>false));?></td>
	
	</tr>
	<tr>
	<td></td>
	<td>提前提醒</td>
	<?php 
	 $option6=array("未收费"=>"未收费","已收费"=>"已收费");
	?>
	<td ><?php echo $form->input('remindBefore',array('after'=>'&nbsp;天','default'=>$data['Candidate']['remindBefore'],'class' => 'TextBox','label'=>false));?>
	</td>
	
	<td></td>
	<td>间隔提醒 </td>
	<td >
	<?php echo $form->input('remindSpacing',array('after'=>'&nbsp;分','default'=>$data['Candidate']['remindSpacing'],'class' => 'TextBox','label'=>false));?>
	</td>
	
	</tr>
	
	<tr>
		<td></td>
		<td style="vertical-align:top;">进度备注</td>
		<td colspan="4"><?php echo $form->textarea('memo',array('default'=>$data['Candidate']['memo'],'class' => 'TextArea txtOut','label'=>false));?></td>
	</tr>
</table>
</fieldset>
	<?php echo $form->button('重置',array('type'=>'reset','class'=>'resetsubmit'));?>  <!-- __('reset', true)取消-->
	<?php echo $form->button('确定',array('type'=>'submit','class'=>'oksubmit'));?>  <!-- __('Add', true)增加-->
</div>	
<?php echo $form->end();?>



